package cn.kkcxy.blog.core.entity.article;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName article_comment
 */
@TableName(value ="article_comment")
@Data
public class ArticleComment implements Serializable {
    /**
     * 评论id
     */
    @TableId(value = "id")
    private Long id;

    /**
     * 文章id
     */
    @TableField(value = "article_id")
    private Long articleId;

    /**
     * 回复类型：0 评论，1 回复
     */
    @TableField(value = "reply_type")
    private Integer replyType;

    /**
     * 父级评论id， 0 为文章一级评论
     */
    @TableField(value = "parent_comment_id")
    private Long parentCommentId;

    /**
     * 评论人id
     */
    @TableField(value = "to_id")
    private Long toId;

    /**
     * 评论人是否为文章作者：0 是，1 否
     */
    @TableField(value = "to_user_author")
    private Integer toUserAuthor;

    /**
     * 回复人id
     */
    @TableField(value = "reply_id")
    private Long replyId;

    /**
     * 回复人是否为文章作者：0 是，1 否 
     */
    @TableField(value = "reply_user_author")
    private Integer replyUserAuthor;

    /**
     * 评论内容
     */
    @TableField(value = "comment_content")
    private String commentContent;

    /**
     * 评论图片地址
     */
    @TableField(value = "comment_picture_url")
    private String commentPictureUrl;

    /**
     * 评论点赞数
     */
    @TableField(value = "likes")
    private Integer likes;

    /**
     * 评论踩数
     */
    @TableField(value = "dislikes")
    private Integer dislikes;

    /**
     * 评论收到的回复数量
     */
    @TableField(value = "reply_count")
    private Integer replyCount;

    /**
     * 评论状态：0 启用，1 禁用
     */
    @TableField(value = "status")
    private Integer status;

    /**
     * 创建人
     */
    @TableField(value = "created_by")
    private Long createdBy;

    /**
     * 创建时间
     */
    @TableField(value = "created_time")
    private Date createdTime;

    /**
     * 最后修改人
     */
    @TableField(value = "updated_by")
    private Long updatedBy;

    /**
     * 最后修改时间
     */
    @TableField(value = "updated_time")
    private Date updatedTime;

    /**
     * 是否删除：0 未删除，1 已删除
     */
    @TableField(value = "deleted")
    private Integer deleted;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ArticleComment other = (ArticleComment) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getArticleId() == null ? other.getArticleId() == null : this.getArticleId().equals(other.getArticleId()))
            && (this.getReplyType() == null ? other.getReplyType() == null : this.getReplyType().equals(other.getReplyType()))
            && (this.getParentCommentId() == null ? other.getParentCommentId() == null : this.getParentCommentId().equals(other.getParentCommentId()))
            && (this.getToId() == null ? other.getToId() == null : this.getToId().equals(other.getToId()))
            && (this.getToUserAuthor() == null ? other.getToUserAuthor() == null : this.getToUserAuthor().equals(other.getToUserAuthor()))
            && (this.getReplyId() == null ? other.getReplyId() == null : this.getReplyId().equals(other.getReplyId()))
            && (this.getReplyUserAuthor() == null ? other.getReplyUserAuthor() == null : this.getReplyUserAuthor().equals(other.getReplyUserAuthor()))
            && (this.getCommentContent() == null ? other.getCommentContent() == null : this.getCommentContent().equals(other.getCommentContent()))
            && (this.getCommentPictureUrl() == null ? other.getCommentPictureUrl() == null : this.getCommentPictureUrl().equals(other.getCommentPictureUrl()))
            && (this.getLikes() == null ? other.getLikes() == null : this.getLikes().equals(other.getLikes()))
            && (this.getDislikes() == null ? other.getDislikes() == null : this.getDislikes().equals(other.getDislikes()))
            && (this.getReplyCount() == null ? other.getReplyCount() == null : this.getReplyCount().equals(other.getReplyCount()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreatedBy() == null ? other.getCreatedBy() == null : this.getCreatedBy().equals(other.getCreatedBy()))
            && (this.getCreatedTime() == null ? other.getCreatedTime() == null : this.getCreatedTime().equals(other.getCreatedTime()))
            && (this.getUpdatedBy() == null ? other.getUpdatedBy() == null : this.getUpdatedBy().equals(other.getUpdatedBy()))
            && (this.getUpdatedTime() == null ? other.getUpdatedTime() == null : this.getUpdatedTime().equals(other.getUpdatedTime()))
            && (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getArticleId() == null) ? 0 : getArticleId().hashCode());
        result = prime * result + ((getReplyType() == null) ? 0 : getReplyType().hashCode());
        result = prime * result + ((getParentCommentId() == null) ? 0 : getParentCommentId().hashCode());
        result = prime * result + ((getToId() == null) ? 0 : getToId().hashCode());
        result = prime * result + ((getToUserAuthor() == null) ? 0 : getToUserAuthor().hashCode());
        result = prime * result + ((getReplyId() == null) ? 0 : getReplyId().hashCode());
        result = prime * result + ((getReplyUserAuthor() == null) ? 0 : getReplyUserAuthor().hashCode());
        result = prime * result + ((getCommentContent() == null) ? 0 : getCommentContent().hashCode());
        result = prime * result + ((getCommentPictureUrl() == null) ? 0 : getCommentPictureUrl().hashCode());
        result = prime * result + ((getLikes() == null) ? 0 : getLikes().hashCode());
        result = prime * result + ((getDislikes() == null) ? 0 : getDislikes().hashCode());
        result = prime * result + ((getReplyCount() == null) ? 0 : getReplyCount().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreatedBy() == null) ? 0 : getCreatedBy().hashCode());
        result = prime * result + ((getCreatedTime() == null) ? 0 : getCreatedTime().hashCode());
        result = prime * result + ((getUpdatedBy() == null) ? 0 : getUpdatedBy().hashCode());
        result = prime * result + ((getUpdatedTime() == null) ? 0 : getUpdatedTime().hashCode());
        result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", articleId=").append(articleId);
        sb.append(", replyType=").append(replyType);
        sb.append(", parentCommentId=").append(parentCommentId);
        sb.append(", toId=").append(toId);
        sb.append(", toUserAuthor=").append(toUserAuthor);
        sb.append(", replyId=").append(replyId);
        sb.append(", replyUserAuthor=").append(replyUserAuthor);
        sb.append(", commentContent=").append(commentContent);
        sb.append(", commentPictureUrl=").append(commentPictureUrl);
        sb.append(", likes=").append(likes);
        sb.append(", dislikes=").append(dislikes);
        sb.append(", replyCount=").append(replyCount);
        sb.append(", status=").append(status);
        sb.append(", createdBy=").append(createdBy);
        sb.append(", createdTime=").append(createdTime);
        sb.append(", updatedBy=").append(updatedBy);
        sb.append(", updatedTime=").append(updatedTime);
        sb.append(", deleted=").append(deleted);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}